import Action from '../actions/types'

export interface StateType {
    selectedTab: string,
    orderCheckoutBackUrl: string
}

const initialState: StateType = {
    selectedTab: "home",
    orderCheckoutBackUrl: ''
};


const handle: Record<string, (state: StateType, action: Action) => StateType> = {
    changeTab: function (state, action) {
        return {...state, selectedTab: action.payload};
    },
    orderCheckoutBackUrlSet: function (state, action) {
        return {...state, orderCheckoutBackUrl: action.payload};
    }
};

export default {initialState, handle}
